//package com.huawei.codearts.tools.aop;
//
//import com.huawei.codearts.tools.utils.ResponseUtils;
//import lombok.extern.slf4j.Slf4j;
//import org.aspectj.lang.JoinPoint;
//import org.aspectj.lang.annotation.*;
//import org.springframework.core.Ordered;
//import org.springframework.stereotype.Component;
//
///**
// * 异常 AOP
// */
//
//@Slf4j
//@Aspect
//@Component
//public class ThrowAspect implements Ordered {
//
//    @Override
//    public int getOrder() {
//        return 1;
//    }
//
//    @Pointcut("execution(* com.huawei.codearts.*.*.*(..))")
//    public void afterThrowing() {
//    }
//
//    @AfterThrowing(pointcut="afterThrowing()", throwing="ex")  // 异常通知  throwing是方法中定义的参数
//    public void doAfterThrowing(JoinPoint joinPoint, Throwable ex) {
//        log.info("Exception in {}.{} message: {}",
//                joinPoint.getSignature().getDeclaringTypeName(),
//                joinPoint.getSignature().getName(),
//                ex.getMessage());
////        log.error("Exception in {}.{}() with cause = '{}' and stackTrace = {}",
////                joinPoint.getSignature().getDeclaringTypeName(),
////                joinPoint.getSignature().getName(),
////                ex.getCause() != null ? ex.getCause() : "NULL",
////                ex);
//
//    }
//
////    @AfterReturning(pointcut="afterThrowing()", returning="a")  // 后置通知  returning是方法中定义的参数
////    public Object doAfterReturning(Throwable a) {
////        log.info("doAfterReturning in {}",123455);
////        return ResponseUtils.logException(a);
////    }
//
//}